
#include "PlayerMoveRight.h"
#include "Weapon.h"

State* PlayerMoveRight::instance=0;

PlayerMoveRight::PlayerMoveRight(vector<Image*> img) : State(img)
{

}

State* PlayerMoveRight::getInstance()
{
    if(instance==0)
    {
        vector<Image*> img;
        Image* im = new Image("./Images/props.bmp");
        im->load();
        img.push_back(im);

        instance = new PlayerMoveRight(img);
    }

    return instance;
}

 void PlayerMoveRight::moveLeft(Entity* player)
{
    player->setCurrentMoveSpeedX(-10);
    player->setState(PlayerMoveLeft::getInstance());
}

void PlayerMoveRight::becomeIdle(Entity* player)
{
    player->setCurrentMoveSpeedX(0);
    player->setCurrentMoveSpeedY(0);
    player->setState(Idle::getInstance());
}

void PlayerMoveRight::shoot(Entity* player)
{
   ( (Weapon*)player->getWeaponClip()->getclippedToMe()->getOwner())->shoot(1,0);
}
